<template>
  <div class="box clearfix">
    <section class="section_wrap">
      <div class="title_sub prduct_bod_r">下户信息：</div>
      <intro :intro="intro" :name="borrowerName"></intro>
      <vuemap v-if="show"></vuemap>
    </section>
    <section class="section_wrap">
      <div class="title_sub infro_bod_l">信息录入：</div>
      <Information ref="info" :info="info"></Information>
    </section>
    <section class="section_wrap">
      <div class="title_sub upload_bod_l">附件管理：</div>
      <upload
        :id="id"
        :imgList="imgList"
        :sStatus="true"
        :showAss="true"
      ></upload>
    </section>
  </div>
</template>
<script>
import Information from "../../components/survey/Information";
import upload from "../../components/survey/upload";
import intro from "../../components/survey/Intro";
import vuemap from "../../components/map/Map";
import { getSurResult } from "../../../src/assets/js/api";
export default {
  components: {
    Information,
    upload,
    vuemap,
    intro,
  },
  data() {
    return {
      show: false,
      borrowerName: "",
      id: 0,
      imgList: [],
      info: {},
      intro: {},
      isNew: true,
      golbalPermissions: [],
    };
  },
  created() {
    this.id = this.$route.query.id;
    this.borrowerName = this.$route.query.borrowerName;
    this.getSurResult();
  },

  methods: {
    //获取下户详情
    getSurResult() {
      getSurResult(this.id).then((res) => {
        this.imgList = res.data.mapSurveyAccessory || [];
        this.info = res.data.tbSurveyDataVo;
        this.intro = res.data.tbSurvey;
        this.isNew = !res.data.hasData;
      });
    },
  },
};
</script>
<style lang="scss" scoped></style>
